const indexHtml = require('../html/index.html')
const detailHtml = require('../html/detail.html')
const tabHtml = require('../html/tab.html')

document.getElementById('app').innerHTML = indexHtml + detailHtml + tabHtml

const btns = document.querySelectorAll('.btn')
const pages = document.querySelectorAll('.page')
btns.forEach(item => {
    item.onclick = () => {
        const index = item.getAttribute('data-index')
        console.log(index)
        pages.forEach(page => {
            page.style.display = 'none'
        })
        pages[Number(index)-1].style.display = 'block'
    }
})

